package com.opal.modules.procurement.controller;

import com.opal.domain.R;
import com.opal.modules.procurement.entity.PurchaseContract;
import com.opal.modules.procurement.service.PurchaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("procurement")
public class PurchaseController {

    @Autowired
    private PurchaseService purchaseContractService;

    /**
     * 采购订单合同唯一性
     * @param purchaseContract
     * @return
     */
    @RequestMapping("queryPurchaseContract")
    @ResponseBody
    public Object queryPurchaseContract(PurchaseContract purchaseContract){
       R r= purchaseContractService.queryPurchaseContractService(purchaseContract);
        return r;
    }

    @RequestMapping("queryTimelyClose")
    @ResponseBody
    public Object queryTimelyClose(String pkOrg){
        R r= purchaseContractService.queryTimelyCloseService(pkOrg);
        return r;
    }

    @RequestMapping("{page}")
    public Object skipPage(@PathVariable("page") String page){
        return "procurement/"+page;
    }

}
